package cn.dtsmusic.controller;

import cn.dtsmusic.model.domain.City;
import cn.dtsmusic.service.CityService;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * CityController
 *
 * @author leobelive
 */
@RestController
@RequestMapping(path = "/city")
//@Slf4j
public class CityController {

	private static Log log = LogFactory.getLog(CityController.class );
    @Autowired
    private CityService cityService;

   @GetMapping("/get/{id}")
    public City getById(@PathVariable Integer id) {
        City city = cityService.selectByPk(id);
        log.debug(city.toString());
        return city;
    }

    @GetMapping("/list/{ids}")
    public ResponseEntity<List<City>> getByIds(@PathVariable List<Integer> ids) {
        List<City> list = cityService.selectByIds(ids);
        log.debug(list);
        return ResponseEntity.ok(list);
    }
    
  
   

}